package com.echo.code.demo;

import com.alibaba.fastjson.JSONObject;
import lombok.*;
import lombok.extern.log4j.Log4j2;

/**
 * Created by baiyp on 2019/05/16.
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@Log4j2
public class User {

    private String name;
    private int age;
    private String address;

    public static void main(String[] args) {
        User user = User.builder().name("echo").age(20).address("Beijing").build();
        String json = JSONObject.toJSONString(user);
        log.info(json);
    }
}
